function  Patente_Borrosa(I)

I = rgb2gray(I);
Blurred = I;

figure;
subplot(3,1,1);imshow(Blurred);title('Blurred Image');

Par = padarray(ones(3,3),[2 2],'replicate','both');
[J P] = deconvblind(Blurred,Par);
subplot(3,1,2);;imshow(J);title('Restauracion con Blind Deconvolution');

[R,C] = size(J);
for i=1:R
    r_max = double(max(J(i,:)));
    r_min = double(min(J(i,:)));
    for j=1:C
        pixel = double(J(i,j));
        if( (pixel - r_min) > 1.2*(r_max - pixel) )
            pixel = 1;
        else
            pixel = 0;
        end
        J(i,j) = pixel;
    end
end
J = J> 0.5;
subplot(3,1,3);;imshow(J);title('Equalizacion y Filtro Binario del Resultado');
